<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
  
		function qmSum(a) {
			// 累加器
			var sum = 0;
			// 循环累加约数
			for(var i = 1 ; i < a ; i++){
				if(a % i === 0){
					sum+=i;//sum存储a的约数和
				}
			}
			
			return sum;
		}
		function isqmSum(a) {//判断亲密数函数
			
			var b = qmSum(a);
			
			if (qmSum(b) === a && a != b) {//b的约数和等于a，等于就是秦秘书，
				return true;
			}else{
				return false;
			}
		}
		
		for (var i = 1 ; i <= 2000 ; i++) {//输出2000以内的部秦秘书
			var j = qmSum(i);
			if (isqmSum(i) && j <= 2000) {
				console.log(i,j);
			}
		}

  </script>
</head>
<body>
  
</body>
</html>